#ifndef STATE_MANAGER_H
#define STATE_MANAGER_H

#include "State.h"

class StateManager : public StateListener
{
public:
	typedef struct
	{
		Ogre::String name;
		State *state;
	} stateInfo;

	StateManager(void);
	~StateManager(void);

	void start(State *state);

	//StateListener virtual members
	void createState(Ogre::String stateName, State *state);
	void changeState(State *state);
	void popState(void);
	void shutdown(void);
	State* findByName(Ogre::String stateName);

private:
	void initialise(State *state);

	std::vector<stateInfo> m_States;
	std::vector<State*> m_ActiveStateStack;
	
	bool m_bShutdown;
};

#endif